<?php
// 返回随机数据
include 'base.php';
$sql = "SELECT * FROM `goods` ORDER BY RAND() LIMIT 0,9";

$res = $conn->query($sql);

$arr = array();
while ($row = mysqli_fetch_assoc($res)) {
  array_push($arr, $row);
}

echo json_encode($arr);